package com.jxfgyj.service.impl;

import java.util.List;

import com.jxfgyj.dao.UserDao;
import com.jxfgyj.domain.DO.jxfgyj_user;
import com.jxfgyj.service.UserService;
import com.jxfgyj.util.UuidUtil;

public class UserServiceImpl implements UserService {

	private UserDao userDao;

	/* 
	 * 
	 */
	public UserDao getUserDao() {
		return userDao;
	}

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	@Override
	public jxfgyj_user login(jxfgyj_user user) {
		jxfgyj_user findResult = userDao.getUser_byLogin(user);
		return findResult;
	}

	@Override
	public boolean createUser(jxfgyj_user user) {
		user.setUser_id(UuidUtil.getUuid());
		user.setUser_type("user");
		return userDao.createUser(user);
	}

	@Override
	public List<jxfgyj_user> listUser() {
		return userDao.listUser();

	}

	@Override
	public void deleteUser(String user_id) {
		userDao.deleteUser_byID(user_id);

	}
}
